// function template
#include <iostream>
using namespace std;

class TestClass
{
public:
  TestClass(int a,int b)
  {
    this -> a = a;
    this -> b = b;
  }

  TestClass(const TestClass &com)
  {
    a = com.a;
    b = com.b;
  }

  bool operator > (TestClass t1)
  {
    if(a>t1.a)
      {
        return true;
      }
    else
      {
        return false;
      }
  }

  TestClass operator = (TestClass t1)
  {
    a = t1.a;
    b = t1.b;
  }

  int getA()
  {
    return a;
  }
  int getB()
  {
    return b;
  }

private:
  int a;
  int b;
};

template <class T>
T GetMax (T a, T b) {
  T result(0,0);
  if(a>b)
    {
      result = a; 
    }
  else
    {
      result = b; 
    }
  //  result = (a>b)? a : b;
  return (result);
}

int main () {
  int i=5, j=6, k;
  long l=10, m=5, n;

  TestClass t1(1,2),t2(3,4),t3(0,0);
  //   k=GetMax<int>(i,j);
  //   n=GetMax<long>(l,m);
  //   cout << k << endl;
  //   cout << n << endl;

  t3 = GetMax<TestClass>(t1,t2);

  cout<<t3.getA()<<endl;
  cout<<t3.getB()<<endl;
  
  return 0;
}
